<template>
  <div style="position: relative">
    <div class="content">
      <div class="info">
        <div class="title">{{ basicInfo.title }}</div>
        <div class="list">
          <div
            class="item"
            v-for="(item, index) of basicInfo.infoList"
            :key="index"
          >
            <div class="tit">{{ item.title }}</div>
            <div class="desc">{{ item.data }}</div>
            <div
              style="
                margin-left: 32px;
                color: #03bfc6;
                line-height: 40px;
                cursor: pointer;
              "
            >
              <i
                class="el-icon-document-copy"
                v-if="item.copy"
                @click="copyAppId(item.data)"
              ></i>
            </div>
          </div>
        </div>
      </div>
      <div class="info" v-if="this.$route.query.type == 1 ? true : false">
        <div class="title">{{ payInfo.title }}</div>
        <div class="list">
          <div
            class="item"
            v-for="(item, index) of payInfo.infoList"
            :key="index"
          >
            <div class="tit">{{ item.title }}</div>
            <div class="desc">{{ item.data }}</div>
          </div>
        </div>
      </div>
      <div class="info" v-else>
        <div class="title">{{ merchantInfo.title }}</div>
        <div class="list" style="position: relative">
          <div
            class="item"
            v-for="(item, index) of merchantInfo.infoList"
            :key="index"
          >
            <div class="tit">{{ item.title }}</div>
            <div class="desc">{{ item.data }}</div>
          </div>
          <div
            style="
              position: absolute;
              right: 0;
              top: 10px;
              color: #03bfc6;
              cursor: pointer;
            "
            @click="openShow = !openShow"
          >
            {{ openShow ? "收起" : "展开" }}
          </div>
          <div v-if="openShow" style="margin-top: 20px">
            <tr class="openBox">
              <td>入账时间</td>
              <td>金额/元</td>
            </tr>
            <div class="openBox1" v-for="(o, oIndex) in openList" :key="oIndex">
              <td>
                {{ o.time }}
              </td>
              <td>
                {{ o.feeAmt }}
              </td>
              <!-- <td :class="o.result == 'success' ? 'succeed' : ''">
                {{ o.result == "success" ? "成功" : "失败" }}
              </td> -->
            </div>
          </div>
        </div>
      </div>
      <div class="info">
        <div class="title">{{ refundInfo.title }}</div>
        <div class="list">
          <div
            class="item"
            v-for="(item, index) of refundInfo.infoList"
            :key="index"
          >
            <div class="tit">{{ item.title }}</div>
            <div class="desc">{{ item.data }}</div>
            <div
              style="
                margin-left: 32px;
                color: #03bfc6;
                line-height: 40px;
                cursor: pointer;
              "
            >
              <i
                class="el-icon-document-copy"
                v-if="item.copy"
                @click="copyAppId(item.data)"
              ></i>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="back" @click="backFn">
      <i class="el-icon-close"></i>
    </div>
    <div class="left">
      <el-breadcrumb separator=">" style="margin-bottom: 20px">
        <el-breadcrumb-item v-for="item of breadList" :key="item">{{
          item
        }}</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
  </div>
</template>

<script>
export default {
  name: "giveBalanceDetail",
  components: {},
  data() {
    return {
      openShow: false,
      breadList: [],
      basicInfo: {
        title: "基本信息",
        infoList: [
          {
            title: "创建时间",
            data: "2023-01-23 14:00",
          },
          {
            title: "云尘付流水号",
            data: "YC739008937420535",
            copy: "true",
          },
          {
            title: "渠道流水号",
            data: "30830839-095-49549712",
          },
          {
            title: "赠送金额",
            data: "150.00",
          },
          {
            title: "赠送说明",
            data: "劳动节充300送50",
          },
          {
            title: "转出账户",
            data: "3321334233",
          },
          {
            title: "转入账户",
            data: "972038523435",
          },
          {
            title: "赠送状态",
            data: "赠送成功",
          },
        ],
      },
      payInfo: {
        title: "变动明细",
        infoList: [
          {
            title: "是否多个收款方",
            data: "否",
          },
          {
            title: "用户ID",
            data: "38489",
          },
          {
            title: "收款账号",
            data: "ioweq@email.com",
          },
          {
            title: "收款名称",
            data: "陕西西高驾校",
          },
        ],
      },
      merchantInfo: {
        title: "赠送明细",
        infoList: [
          {
            title: "赠送模式",
            data: "多段入账",
          },
        ],
      },
      openList: [
        {
          time: "2023.01.23 14:00",
          feeAmt: "294.36",
        },
        {
          time: "2023.01.23 14:00",
          feeAmt: "294.36",
        },
      ],
      refundInfo: {
        title: "退款信息",
        infoList: [
          {
            title: "是否退款",
            data: "是",
          },
          {
            title: "退款时间",
            data: "2023.01.23 14:00",
          },
          {
            title: "退款金额",
            data: "30",
          },
        ],
      },
    };
  },
  created() {
    this.breadList = this.$route.meta.title;
    //console.log(this.$route.query.id);
    //   let id = this.$route.query.id;
    //   if (id) {
    //     this.$http.post("/api/settle/payout/getSettleDetailById", {
    //       id
    //     }).then((res) => {
    //       if (res.code === "0000") {
    //         console.log(res.data)
    //         // this.info = res.data;
    //       }
    //     });
    //   }
  },
  methods: {
    backFn() {
      this.$backTo("/account/give_balance");
    },
    copyAppId(value) {
      const input = document.createElement("input"); // 创建input对象
      input.value = value; // 设置复制内容
      document.body.appendChild(input); // 添加临时实例
      input.select(); // 选择实例内容
      document.execCommand("Copy"); // 执行复制
      document.body.removeChild(input); // 删除临时实例
      this.$message.success("复制成功！");
    },
  },
};
</script>

<style scoped lang="scss">
.succeed {
  color: #07a555;
}
.content {
  min-height: 780px;
  padding: 160px 100px;
  display: flex;
  justify-content: start;
  flex-wrap: wrap;
  .info {
     width: 33.3%;
    min-width: 500px;
    margin-bottom: 40px;
    padding: 0 2%;
    .title {
      font-size: 14px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #1d1c1c;
      padding-bottom: 15px;
      border-bottom: 1px solid #03bfc6;
    }
    .list {
      margin-top: 35px;
      .item {
        display: flex;
        .tit {
          min-width: 100px;
          margin-right: 32px;
          font-size: 14px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #869daa;
          line-height: 40px;
          text-align: right;
        }
        .desc {
 font-size: 14px;
          font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
          color: #1d1c1c;
          line-height: 40px;
          overflow: hidden;
          word-wrap: break-word;
        }
      }
      .openBox {
        margin-bottom: 20px;
        height: 22px;
        font-size: 15px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 600;
        color: #1d1c1c;
        line-height: 22px;
        display: flex;
        justify-content: start;
        td {
          display: inline-block;
        min-width: 39%;
        padding: 0 40px 0 0;
        }
      }
      .openBox1 {
        margin-bottom: 20px;
        height: 22px;
        font-size: 14px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 400;
        color: #1d1c1c;
        line-height: 22px;
        display: flex;
        justify-content: start;
        text-align: left;
        td {
          padding: 0 40px 0 0;
        min-width: 39%;
        width: 1px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        }
      }
    }
  }
}
.back {
  position: absolute;
  right: 55px;
  top: 20px;
  font-size: 20px;
  cursor: pointer;
}
.left {
  position: absolute;
  left: 55px;
  top: 31px;
  height: 20px;
  font-size: 14px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #869daa;
  line-height: 20px;
}
// :deep(.el-table__expand-icon) {
//   // position: absolute;
//   // left:140px;
//   float: left;
// }
@media screen and (max-width: 1770px) {
  .content {
    .info {
      box-sizing: content-box !important;
      width: 33.3% ;
      min-width: 520px;
      margin-bottom: 40px;
      padding: 0 5.5%;
    }
  }
}

@media screen and (max-width: 1550px) {
  .content {
    .info {
      box-sizing: content-box !important;
      width: 33.3% ;
      min-width: 488px;
      margin-bottom: 40px;
      padding: 0 2%;
    }
  }
}
</style>
